<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>导航栏</title>

    <style>
        * {
            margin: 0;
            padding: 0;
        }
        ul {
            list-style: none;
        }
        a {
            text-decoration: none;
            color: #333;
        }

        nav {
            width: 500px;
            margin: 10px auto 0px;
            box-shadow: 0px 2px 4px 1px rgba(0,0,0,0.3);
        }
        nav::after {
            content: '';
            display: block;
            clear: both;
        }

        nav>ul>li {
            float: left;
            position: relative;
            text-align: center;

        }

        nav>ul>li:hover .child {
            display: block;
        }

        nav a {
            padding: 10px ;
            /*background-color: pink;*/
            display: block;
            min-width: 60px;

        }

        nav a:hover {
            background-color: rgba(0,0,0,0.4);
            color: #fff;
        }

        nav .child {
            position: absolute;
            box-shadow: 0px 2px 4px 1px rgba(0,0,0,0.3);
            display: none;
        }



    </style>
</head>
<body>
    <nav>
        <ul>
            <li><a href="#">首页</a></li>
            <li><a href="#">作品</a></li>
            <li>
                <a href="#">更多</a>
                <ul class="child">
                    <li><a href="#">Github</a></li>
                    <li><a href="#">博客</a></li>
                    <li><a href="#">知乎</a></li>
                </ul>
            </li>
        </ul>
    </nav>
</body>
</html>